package niuke;

import java.math.BigInteger;
import java.util.Scanner;

/**
 * 描述
 * 正整数A和正整数B 的最小公倍数是指 能被A和B整除的最小的正整数值，设计一个算法，求输入A和B的最小公倍数。
 */
public class HJ108 {

    public static void main(String[] args) {
        //test1();
        test2();
    }

    private static void test2() {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            int n = scanner.nextInt();
            int m = scanner.nextInt();
            int sum = n * m;
            int t;
            if (n < m) {
                t = n;
                n = m;
                m = t;
            }
            while (m != 0) {
                t = n % m;
                n = m;
                m = t;
            }
            System.out.println("最大公约数："+n);
            System.out.println("最小公倍数："+(sum/n));
            System.out.println(sum / n);
        }
    }

    private static void test1() {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            BigInteger a = scanner.nextBigInteger();
            BigInteger b = scanner.nextBigInteger();
            BigInteger gcd = a.gcd(b); // 求两个数的最大公约数
            System.out.println(gcd);
            System.out.println(a.multiply(b).divide(gcd));
        }
    }
}
